//对外暴露配置路由(常量路由):全部用户都可以访问到的路由
export const constantRoute = [
    {
        //登录
        path: '/login',
        component: () => import('@/views/login/index.vue'),
        name: 'login',
        meta: {
            title: '登录',//菜单标题
            hidden: true,//代表路由标题在菜单中是否隐藏  true:隐藏 false:不隐藏
            icon: "Promotion",//菜单文字左侧的图标,支持element-plus全部图标
        }
    }
    ,
    {
        //登录成功以后展示数据的路由
        path: '/',
        component: () => import('@/layout/index.vue'),
        name: 'layout',
        meta: {
            title: '',
            hidden: false,
            icon: ''
        },
        redirect: '/home',
        children: [
            {
                path: '/home',
                component: () => import('@/views/home/index.vue'),
                meta: {
                    title: '首页',
                    hidden: false,
                    icon: 'HomeFilled'
                }
            }
        ]
    },
    {
        //404
        path: '/404',
        component: () => import('@/views/404/index.vue'),
        name: '404',
        meta: {
            title: '404',
            hidden: true,
            icon: 'DocumentDelete'
        }
    },
]

//异步路由
export const asnycRoute = [
    {
        path: '/sys',
        component: () => import('@/layout/index.vue'),
        name: 'sys',
        meta: {
            title: '系统管理',
            icon: 'Lock'
        },
        redirect: '/sys/log',
        children: [
            {
                path: '/sys/log',
                component: () => import('@/views/sys/log/index.vue'),
                name: 'sys:log',
                meta: {
                    title: '日志管理',
                    icon: 'User'
                }
            },
            {
                path: '/sys/quartz',
                component: () => import('@/views/sys/quartz/index.vue'),
                name: 'sys:quartz',
                meta: {
                    title: '定时任务管理',
                    icon: 'UserFilled'
                }
            },
            {
                path: '/sys/actCode',
                component: () => import('@/views/sys/actCode/index.vue'),
                name: 'sys:actCode',
                meta: {
                    title: '激活码管理',
                    icon: 'UserFilled'
                }
            },
            {
                path: '/sys/datasource',
                component: () => import('@/views/sys/datasource/index.vue'),
                name: 'sys:datasource',
                meta: {
                    title: '数据源管理',
                    icon: 'UserFilled'
                }
            },
            {
                path: '/sys/tableConfig',
                component: () => import('@/views/sys/tableConfig/index.vue'),
                name: 'sys:tableConfig',
                meta: {
                    title: '代码生成管理',
                    icon: 'UserFilled'
                }
            },
            {
                path: '/sys/dict',
                component: () => import('@/views/sys/dict/index.vue'),
                name: 'sys:dict',
                meta: {
                    title: '字典管理',
                    icon: 'UserFilled'
                }
            },
            {
                path: '/sys/actCode',
                component: () => import('@/views/acl/permission/index.vue'),
                name: 'Permission',
                meta: {
                    title: '菜单管理',
                    icon: 'Monitor'
                }
            }
        ]
    }
    ,
    {
        path: '/business',
        component: () => import('@/layout/index.vue'),
        name: 'business',
        meta: {
            title: '业务中心',
            icon: 'Goods',
        },
        redirect: '/business/message',
        children: [
            {
                path: '/business/message',
                component: () => import('@/views/business/message/index.vue'),
                name: "business:message",
                meta: {
                    title: '消息中心',
                    icon: 'ShoppingCartFull',
                }
            },
            {
                path: '/business/article',
                component: () => import('@/views/business/article/index.vue'),
                name: "business:article",
                meta: {
                    title: '文章管理',
                    icon: 'ChromeFilled',
                }
            },
            {
                path: '/business/exam',
                component: () => import('@/views/business/exam/index.vue'),
                name: "business:exam",
                meta: {
                    title: '审核管理',
                    icon: 'Calendar',
                }
            },
            {
                path: '/business/tag',
                component: () => import('@/views/business/tag/index.vue'),
                name: "business:tag",
                meta: {
                    title: '文章标签管理',
                    icon: 'Calendar',
                }
            },
            {
                path: '/business/order',
                component: () => import('@/views/business/order/index.vue'),
                name: "business:order",
                meta: {
                    title: '订单管理',
                    icon: 'Calendar',
                }
            },
            {
                path: '/business/product',
                component: () => import('@/views/business/product/index.vue'),
                name: "business:product",
                meta: {
                    title: '商品管理',
                    icon: 'Calendar',
                }
            },
            {
                path: '/business/user',
                component: () => import('@/views/business/user/index.vue'),
                name: "business:user",
                meta: {
                    title: '用户管理',
                    icon: 'Calendar',
                }
            },
            {
                path: '/business/role',
                component: () => import('@/views/business/role/index.vue'),
                name: "business:role",
                meta: {
                    title: '角色管理',
                    icon: 'Calendar',
                }
            },
            {
                path: '/business/menu',
                component: () => import('@/views/business/menu/index.vue'),
                name: "business:menu",
                meta: {
                    title: '权限管理',
                    icon: 'Calendar',
                }
            },
            {
                path: '/product/sku',
                component: () => import('@/views/product/sku/index.vue'),
                name: "Sku",
                meta: {
                    title: 'SKU管理',
                    icon: 'Orange',
                }
            },
        ]
    }
]

//任意路由
export const anyRoute = {
    //任意路由
    path: '/:pathMatch(.*)*',
    redirect: '/404',
    name: 'Any',
    meta: {
        title: '任意路由',
        hidden: true,
        icon: 'DataLine'
    }
}
